<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function splicc() {
            //这种只能拿掉第一个
            var arr = ["a", "b", "c", "d", "d", "f", "g"]
            function get(parms) {
                for (var i = 0; i < arr.length; i++) {
                    var item = arr[i]
                    if (parms === item) {
                        console.log(arr.length)
                        arr.splice(i, 1)
                        console.log(arr.length)
                    }
                    console.log(arr)
                }

            }
            return get
        }
        var test = splicc();
        // test("k");
        test("d");
    </script>
</body>

</html>